package com.java.common.constants;

import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * 状态码
 */
@Getter
public enum ResultCodeEnum {

	/*200成功*/
	SUCCESS(HttpStatus.OK.value(),"success"),
	/*500错误*/
	ERROR(HttpStatus.INTERNAL_SERVER_ERROR.value(), "未知异常，请联系管理员"),

	BAD_SQL_GRAMMAR(21001, "sql语法错误"),
	JSON_PARSE_ERROR(21002, "json解析异常"),
	PARAM_ERROR(21003, "参数不正确"),
	FILE_UPLOAD_ERROR(21004, "文件上传错误"),
	EXCEL_DATA_IMPORT_ERROR(21005, "Excel数据导入错误"),

	URL_ENCODE_ERROR(22001,"url编码失败"),
	ILLEGAL_CALLBACK_REQUEST_ERROR(22002,"非法的回调请求"),
	FETCH_USER_INFO_ERROR(22003,"获取用户信息错误");


	private Integer code;

	private String message;

	ResultCodeEnum(Integer code, String message) {
		this.code = code;
		this.message = message;
	}
}